dofile(arg[1])
require("lfs")
require("cosmo")
require("sputnik_config")

source = "sputnik_config.lua"
dest = "new_sputnik_config.lua"
local f = io.open(source)
local text = f:read("*all")
f:close()
math.randomseed(os.time())
local code = ""
for i=1,20 do 
   code = code .. string.format("%03d", 1000*math.random())
end
local new_text = cosmo.fill(text, 
			    {  script_path = arg[2] .. "/sputnik.lua",
			       secret_code = code })
f = io.open(dest, "w")
f:write(new_text)
f:close()

